type vendor_displayfeature, domain;
type vendor_displayfeature_exec, exec_type, vendor_file_type, file_type;

type vendor_hal_displayfeature_xiaomi_default, domain;
type vendor_hal_displayfeature_xiaomi_default_exec, exec_type, vendor_file_type, file_type;
type vendor_hal_displayfeature_xiaomi_hwservice, hwservice_manager_type, protected_hwservice;
type vendor_DisplayFeatureControl_service, vndservice_manager_type;

hal_server_domain(vendor_hal_displayfeature_xiaomi_default, vendor_hal_displayfeature_xiaomi)
hal_attribute_hwservice(vendor_hal_displayfeature_xiaomi, vendor_hal_displayfeature_xiaomi_hwservice)

vendor_restricted_prop(vendor_displayfeature_prop)

init_daemon_domain(vendor_displayfeature)
init_daemon_domain(vendor_hal_displayfeature_xiaomi_default)

vndbinder_use(vendor_displayfeature)
vndbinder_use(vendor_hal_displayfeature_xiaomi)

binder_call(vendor_hal_displayfeature_xiaomi_client, vendor_hal_displayfeature_xiaomi_server)
binder_call(vendor_hal_displayfeature_xiaomi_server, vendor_hal_displayfeature_xiaomi_client)

hal_client_domain(vendor_displayfeature, vendor_hal_displayfeature_xiaomi)

add_service(vendor_displayfeature, vendor_DisplayFeatureControl_service)

hwbinder_use(vendor_displayfeature)
get_prop(vendor_displayfeature, hwservicemanager_prop)

hal_client_domain(system_app, vendor_hal_displayfeature_xiaomi)

binder_call(system_server, vendor_hal_displayfeature_xiaomi_default)
binder_call(vendor_displayfeature, system_server)
binder_call(vendor_hal_displayfeature_xiaomi, hal_graphics_composer_default)
binder_call(vendor_hal_displayfeature_xiaomi_default, system_server)
binder_call(vendor_hal_displayfeature_xiaomi_default, vendor_hal_display_color_default)
binder_call(vendor_hal_displayfeature_xiaomi_default, vendor_hal_citsensorservice_xiaomi_default)

r_dir_file(vendor_hal_displayfeature_xiaomi, vendor_sysfs_graphics)

allow vendor_displayfeature graphics_device:chr_file rw_file_perms;
allow vendor_hal_displayfeature_xiaomi_default graphics_device:chr_file rw_file_perms;

allow vendor_hal_displayfeature_xiaomi_default vendor_sysfs_graphics:dir r_dir_perms;
allow vendor_hal_displayfeature_xiaomi_default vendor_sysfs_graphics:file rw_file_perms;

allow vendor_hal_displayfeature_xiaomi_default vendor_display_vendor_data_file:dir create_dir_perms;
allow vendor_hal_displayfeature_xiaomi_default vendor_display_vendor_data_file:file create_file_perms;

allow vendor_hal_displayfeature_xiaomi_default fwk_sensor_hwservice:hwservice_manager find;
allow vendor_hal_displayfeature_xiaomi_default vendor_hal_citsensorservice_xiaomi_hwservice:hwservice_manager find;
allow vendor_hal_displayfeature_xiaomi_default vendor_hal_display_config_hwservice:hwservice_manager find;
allow vendor_hal_displayfeature_xiaomi_default vendor_hal_display_postproc_hwservice:hwservice_manager find;
allow vendor_hal_displayfeature_xiaomi_default vendor_mistcdisplay_service:service_manager find;
allow vendor_hal_displayfeature_xiaomi_default vendor_qdisplay_service:service_manager find;

get_prop(vendor_displayfeature, vendor_displayfeature_prop)
get_prop(vendor_hal_displayfeature_xiaomi_default, vendor_mpctl_prop)
set_prop(vendor_hal_displayfeature_xiaomi_default, vendor_displayfeature_prop)
set_prop(vendor_hal_displayfeature_xiaomi_default, vendor_display_prop)

allow vendor_hal_displayfeature_xiaomi vendor_sysfs_graphics:file rw_file_perms;
allow vendor_hal_displayfeature_xiaomi vendor_qdisplay_service:service_manager find;
allow vendor_hal_displayfeature_xiaomi hal_graphics_composer:binder { call transfer };
allow vendor_hal_displayfeature_xiaomi hal_graphics_composer:fd *;
allow vendor_hal_displayfeature_xiaomi graphics_device:chr_file rw_file_perms;
allow vendor_hal_displayfeature_xiaomi graphics_device:dir r_dir_perms;
allow vendor_hal_displayfeature_xiaomi_default sysfs:file { getattr open read write };
allow vendor_hal_displayfeature_xiaomi_default sensors_device:chr_file r_file_perms;
allow vendor_hal_displayfeature_xiaomi_default system_server:binder { call transfer };
allow vendor_hal_displayfeature_xiaomi_default vendor_hal_display_config_hwservice:binder { call transfer };
allow vendor_hal_displayfeature_xiaomi_default vendor_hal_display_config_hwservice:fd *;
allow vendor_hal_displayfeature_xiaomi_default vendor_displayfeature_device:chr_file { ioctl open read write };
allow vendor_hal_displayfeature_xiaomi_default vendor_sysfs_displayfeature:dir r_dir_perms;
allow vendor_hal_displayfeature_xiaomi_default vendor_sysfs_displayfeature:file rw_file_perms;
allow vendor_hal_displayfeature_xiaomi_default system_app:binder { call transfer };
allow vendor_hal_displayfeature_xiaomi_default system_app:fd *;
allow vendor_hal_displayfeature_xiaomi_default surfaceflinger:binder call;
allow vendor_hal_displayfeature_xiaomi_client vendor_hal_displayfeature_xiaomi_server:binder { call transfer };
allow vendor_hal_displayfeature_xiaomi_client vendor_hal_displayfeature_xiaomi_server:fd *;
allow vendor_hal_displayfeature_xiaomi_client vendor_hal_displayfeature_xiaomi_hwservice:hwservice_manager find;
allow vendor_hal_displayfeature_xiaomi_server vendor_hal_displayfeature_xiaomi_client:binder transfer;
init_daemon_domain(vendor_hal_displayfeature_xiaomi_default)
unix_socket_connect(vendor_hal_displayfeature_xiaomi_default, property, vendor_sensors)
vndbinder_use(vendor_hal_displayfeature_xiaomi)
hal_client_domain(vendor_hal_displayfeature_xiaomi_default, vendor_hal_display_color)
hal_client_domain(vendor_hal_displayfeature_xiaomi_default, vendor_hal_display_postproc)
add_hwservice(vendor_hal_displayfeature_xiaomi_server, vendor_hal_displayfeature_xiaomi_hwservice)

allow vendor_displayfeature system_server:binder transfer;
allow vendor_displayfeature system_server:binder { call transfer };
allow vendor_displayfeature system_server:fd *;
allow vendor_displayfeature appdomain:binder { call transfer };
allow vendor_displayfeature appdomain:fd *;
allow vendor_displayfeature sysfs:file { getattr open read write };
allow vendor_displayfeature vendor_file:file r_file_perms;
allow vendor_displayfeature graphics_device:dir r_dir_perms;
init_daemon_domain(vendor_displayfeature)
get_prop(vendor_displayfeature, hwservicemanager_prop)
hwbinder_use(vendor_displayfeature)
vndbinder_use(vendor_displayfeature)
hal_client_domain(vendor_displayfeature, hal_graphics_composer)
hal_client_domain(vendor_displayfeature, hal_light)
hal_client_domain(vendor_displayfeature, vendor_hal_display_color)
hal_client_domain(vendor_displayfeature, vendor_hal_display_postproc)
hal_client_domain(vendor_displayfeature, vendor_hal_displayfeature_xiaomi)
add_service(vendor_displayfeature, vendor_DisplayFeatureControl_service)
